home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -websites- / wirenet / files / thor25_arexx.lha / GoldED / FigletV2.0.ged < prev    next >
Text File  |  1995-06-09  |  2KB  |  58 lines

  1. /* Figlet.ged by Troels Walsted Hansen
  2. ** $VER: Figlet.ged v1.00 (09.06.95)
  3. **
  4. ** An ARexx script that asks you for a string and a figlet font,
  5. ** and then, using the figlet program, writes whatever string you
  6. ** entered, in the font you chose, into the editor.
  7. */
  8.  
  9. /* some user variables. edit to your hearts content */
  10.  
  11. figletprogpath = "Work:Verktøy/TextUtils/Figlet/"
  12. figletfontpath = "Work:Verktøy/TextUtils/Figlet/"
  13.  
  14. /* needs GoldED functions */
  15.  
  16. options results
  17.  
  18. if(substr(address(),1,6) ~= "GOLDED") then
  19. do
  20.     say "This script should only be started from inside GoldED."
  21.     exit 20
  22. end
  23. else gedport = address()
  24.  
  25. /* get string */
  26.  
  27. address(gedport)
  28. REQUEST BODY '"Enter some text:"' BUTTON '"_Ok|_Cancel"' TITLE '"Figlet.ged"' VAR figletstring STRING
  29. if(rc ~= 0) then exit
  30.  
  31. /* get fontname */
  32.  
  33. REQUEST TITLE '"Select figlet font:"' FILE PATH '"'figletfontpath'"' MASK '"#?.flf"' VAR figletfont
  34. if(rc ~= 0) then exit
  35.  
  36. lastchar = right(figletfont,3)
  37. if(lastchar ~= "flf" | figletfont = "") then exit
  38.  
  39. /* run figlet */
  40.  
  41. call open(ofh, "T:figlet.fse.temp.file1", W)
  42.     call writeln(ofh, figletstring)
  43. call close(ofh)
  44.  
  45. QUERY RIGHT VAR columnsnumber
  46.  
  47. address command
  48. figletprogpath || 'figlet <T:figlet.fse.temp.file1 >T:figlet.fse.temp.file2 ' || delstr(figletfont, lastpos(".",figletfont)) || ' center columns ' || columnsnumber
  49.  
  50. address(gedport)
  51. OPEN NAME '"T:figlet.fse.temp.file2"' FAST INSERT
  52.  
  53. /* cleanup and exit */
  54.  
  55. if(exists("T:figlet.fse.temp.file1")) then address command 'delete >nil: "T:figlet.fse.temp.file1"'
  56. if(exists("T:figlet.fse.temp.file2")) then address command 'delete >nil: "T:figlet.fse.temp.file2"'
  57. exit
  58.